﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace myTools
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            try
            {
                tabMain.TabPages.Clear();


                tsbtnGetNetIp.PerformClick();
                tsbtnGetMd5.PerformClick();               
                tsbtnGetUUID.PerformClick();
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        private void tsbtnGetNetIp_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    TabPage page = new TabPage();
                    page.Text = "获取外网IP";
                    ucGetNetIp uc = new ucGetNetIp();
                    uc.Dock = DockStyle.Fill;
                    page.Controls.Add(uc);
                    tabMain.TabPages.Add(page);
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        private void tsbtnGetUUID_Click(object sender, EventArgs e)
        {
            try
            {
                TabPage page = new TabPage();
                page.Text = "生成UUID";
                ucGetUUID uc = new ucGetUUID();
                uc.Dock = DockStyle.Fill;
                page.Controls.Add(uc);
                tabMain.TabPages.Add(page);
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        private void tsbtnGetMd5_Click(object sender, EventArgs e)
        {
            try
            {
                TabPage page = new TabPage();
                page.Text = "计算MD5";
                ucMd5 uc = new ucMd5();
                uc.Dock = DockStyle.Fill;
                page.Controls.Add(uc);
                tabMain.TabPages.Add(page);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    }
}
